//
//  OnlineShoppingViewController.m
//  NewApp
//
//  Created by  on 12-7-9.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "OnlineShoppingViewController.h"
#import "OnlineShoppingDetailsViewController.h"
#import "OnlineShoppingSearchResultViewController.h"

@interface OnlineShoppingViewController ()

@end

@implementation OnlineShoppingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (void) dealloc {
    [super dealloc];
}

- (void) loadRequest {
    [self.engine onlineShoppingInfos];
}

- (void) viewDetailsWithCategory:(NACategory *)cat {
    if (nil == cat) 
        return;
    self.title = @"返回";
    OnlineShoppingDetailsViewController *viewCtrl = [[OnlineShoppingDetailsViewController alloc] initWithCategory:cat];
    [self.navigationController pushViewController:viewCtrl animated:YES];
    [viewCtrl release]; 
}

- (void) searchButtonDidPressed {
    if (_searchBar.keywordTextfield.text.length == 0) 
        return;
    self.title = @"返回";
    OnlineShoppingSearchResultViewController *viewCtrl = [[OnlineShoppingSearchResultViewController alloc] initWithID:nil keyword:_searchBar.keywordTextfield.text];
    [self.navigationController pushViewController:viewCtrl animated:YES];
    [viewCtrl release];
}


@end
